using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework.Domain.Specifications
{
    /// <summary>
    /// Specifications for the notspecifcation.
    /// </summary>
    [TestClass]
    public class WhenTestingSatisfactionOfNotSpecification
    {
        /// <summary>
        /// Should not be satisfied when the contained specification is satisfied.
        /// </summary>
        [TestMethod]
        public void ShouldNotBeSatisfiedWhenContainedSpecificationIsSatisfied()
        {
            ISpecification<int> specification = new NotSpecification<int>(new FalseSpecification<int>());
            Assert.IsTrue(specification.IsSatisfiedBy(0));
        }

        /// <summary>
        /// Should be satisfied when the contained specification is not satisfied.
        /// </summary>
        [TestMethod]
        public void ShouldBeSatisfiedWhenContainedSpecificationIsNotSatisfied()
        {
            ISpecification<int> specification = new NotSpecification<int>(new TrueSpecification<int>());
            Assert.IsFalse(specification.IsSatisfiedBy(0));
        }
    }
}